import request from '@/utils/request'

// 查询生产退料入库主列表
export function listProMat(query) {
  return request({
    url: '/putStorageData/proMat/list',
    method: 'get',
    params: query
  })
}

// 查询生产退料入库主详细
export function getProMat(rtmId) {
  return request({
    url: '/putStorageData/proMat/' + rtmId,
    method: 'get'
  })
}

// 新增生产退料入库主
export function addProMat(data) {
  return request({
    url: '/putStorageData/proMat',
    method: 'post',
    data: data
  })
}

// 修改生产退料入库主
export function updateProMat(data) {
  return request({
    url: '/putStorageData/proMat',
    method: 'put',
    data: data
  })
}

// 删除生产退料入库主
export function delProMat(rtmId) {
  return request({
    url: '/putStorageData/proMat/' + rtmId,
    method: 'delete'
  })
}

// 导出生产退料入库主
export function exportProMat(query) {
  return request({
    url: '/putStorageData/proMat/export',
    method: 'get',
    params: query
  })
}
// 查询可接受的子项明细
export function serachChild(query) {
  return request({
    url: '/putStorageData/proMat/serachChild',
    method: 'get',
    params: query
  })
}
//获取子项数据
export function listRtdDet(rtmDjbh){
  return request({
    url: '/putStorageData/proMat/listRtdDet/'+rtmDjbh,
    method: 'get',
  })
}
//添加子项数据
export function insRtdDet(data){
  return request({
    url: '/putStorageData/proMat/insRtdDet',
    method: 'post',
    data: data
  })
}
//删除子项物料信息
export function removeRtdDet(rtdId){
  return request({
    url: '/putStorageData/proMat/removeRtdDet/'+rtdId,
    method: 'delete'
  })
}
//获取详细数据
export function rtdDetById(rtdId){
  return request({
    url: '/putStorageData/proMat/rtdDetById/'+rtdId,
    method: 'get',
  })
}
//更新详细表数据.
export function updRtdDet(data){
  return request({
    url: '/putStorageData/proMat/updRtdDet',
    method: 'post',
    data:data
  })
}
//一键入库
export function allCredit(rtmDjbh){
  return request({
    url: '/putStorageData/proMat/allCredit/'+rtmDjbh,
    method: 'put'
  })
}
//撤回开单
export function backFinish(rtmDjbh){
  return request({
    url: '/putStorageData/proMat/backFinish/'+rtmDjbh,
    method: 'put'
  })
}



